package com.cmcc.cmii.smsim.config;


import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.Date;
import java.util.Properties;


/**
 * @author Thanks
 */
@Configuration
@MapperScan(basePackages = {"com.cmcc.cmii.smsim.mapper.**"})
public class MybatisConfig {


/*    @Bean
    public PerformanceInterceptor performanceInterceptor() {
        PerformanceInterceptor performanceInterceptor = new PerformanceInterceptor();

        //sql格式化
        performanceInterceptor.setFormat(true);
        return performanceInterceptor;
    }*/

    @Bean
    public PaginationInterceptor paginationInterceptor() {
        PaginationInterceptor paginationInterceptor = new PaginationInterceptor();
        //paginationInterceptor.setDialectType("mysql");
        Properties properties = new Properties();
        properties.setProperty("dialectType","mysql");
        paginationInterceptor.setProperties(properties);
        return paginationInterceptor;
    }


  public static void main(String[] args) {
        Date date = new Date();
        String year = String.format("%tY", date);
        String month = String.format("%tm",date);
        System.out.println(year+month);
    }

}
